home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEV / I-Z / TransSkel.cpt / miniDisplay.pas < prev    next >
Pascal/Delphi Source File  |  1987-01-11  |  2KB  |  84 lines

  1. {    MiniDisplay - TransDisplay Demonstration.  Very simple:  just}
  2. {    demonstrates the various output calls.}
  3.  
  4. {    The project should include MiniDisplay.pas (this file),}
  5. {    TransDisplay.pas (or a project made from TransDisplay.pas),}
  6. {    TransSkelpas (or a project made from TransSkelpas), MacPasLib and MacTraps.}
  7.  
  8. {    4 October 1986        Paul DuBois}
  9. {    10 January 1987        Owen Hartnett    Lightspeed Pascal version    }
  10. {    Ωhm Software, 163 Richard Drive, Tiverton, RI 02878                }
  11.  
  12. PROGRAM MiniDisplay;
  13.  
  14.     USES
  15.         TransSkelPas, TransDisplay;
  16.  
  17.     PROCEDURE DoFileMenu (item : integer);        { ignored - there's only Quit }
  18.     BEGIN
  19.         SkelWhoa;                { tell SkelMain to quit }
  20.     END;
  21.  
  22.     VAR
  23.         r : Rect;
  24.         m : MenuHandle;
  25.         w : WindowPtr;
  26.         theStr : Str255;
  27.         myPtr : Ptr;
  28.  
  29. BEGIN
  30.     SkelInit;                    { initialize }
  31.     TransDisplayInit;
  32.     SkelApple('', NIL);        { handle desk accessories }
  33.  
  34.     m := NewMenu(2, 'File');        { create menu }
  35.     AppendMenu(m, 'Quit/Q');
  36.     SkelMenu(m, @DoFileMenu, NIL);    { tell TransSkel to handle it }
  37.  
  38.  
  39.     SetRect(r, 100, 75, 400, 250);
  40.     w := NewDWindow(r, 'MiniDisplay', false, WindowPtr(-1), false, longint(0));
  41.  
  42.     DisplayString('This is MiniDisplay, a minimal demonstration of');
  43.     Displayln;
  44.     DisplayString('TransDisplay.  The following types of output may');
  45.     Displayln;
  46.     DisplayString('be written with the built-in output calls:');
  47.  
  48.     Displayln;
  49.     DisplayString('Arbitrary length text:');
  50.     theStr := 'Some Text';
  51.     myPtr := Ptr(longint(@theStr) + 1);
  52.     DisplayText(myPtr, longint(theStr[0]));
  53.     Displayln;
  54.     DisplayString('String:');
  55.     DisplayString('"this is a string"');
  56.     Displayln;
  57.     DisplayString('Char: ');
  58.     DisplayChar('x');
  59.     DisplayString('    Hex char:  ');
  60.     DisplayHexChar('x');
  61.     Displayln;
  62.     DisplayString(' Int: ');
  63.     DisplayInt(1023);
  64.     DisplayString('    Hex int:  ');
  65.     DisplayHexInt(1023);
  66.     Displayln;
  67.     DisplayString('  Long: ');
  68.     DisplayLong(longint(32768));
  69.     DisplayString('  Hex long:  ');
  70.     DisplayHexLong(longint(32768));
  71.     DisplayString('  Boolean:  ');
  72.     DisplayBoolean(true);
  73.     DisplayString(', ');
  74.     DisplayBoolean(false);
  75.     Displayln;
  76.     DisplayString('Carriage Return: ');
  77.     Displayln;
  78.     DisplayString('Select quit from the File menu to exit');
  79.     SetDWindowPos(w, 0);    { scroll back to top }
  80.     ShowWindow(w);
  81.  
  82.     SkelMain;                    { loop 'til Quit selected }
  83.     SkelClobber;                    { clean up }
  84. END.